package com.fast.cms.model.article;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;

import com.fast.base.db.model.Commnent;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 文章表
 * 
 * @author Administrator
 */
@Entity
@Table(name = "T_dv_Article")
@DynamicInsert(true)
@DynamicUpdate(true)
@Commnent("资讯信息")
public class Article implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false, length = 10)
	private int id = 0;
	private String uuid = "";
	@Column(length = 256)
	private String articleTitile = "";// 文章标题
	@Column(name = "old_title", length = 256)
	private String oldTitle = "";// 原标题
	@Column(length = 2000)
	private String keywords = "";// 关键字
	@Column(length = 4000)
	private String content = "";// 资讯简要
	@Column(name = "source_from", length = 256)
	private String sourceFrom = "";// 数据来源
	private int status = 1;// 1.开放状态 2.屏弊状态 3.仅作者可看

	@Basic(fetch = FetchType.LAZY)
	@Type(type = "text")
	@Column(name = "articleDetail", nullable = true)
	private String articleDetail = "";// 文章内容
	private String columnId = "";
	private String columnDir = "";// 栏目路径：新闻》公告》通知
	private String columnName = "";// 所属栏目
	private String articleTypeId = "";// 所属类型id
	private String articleType = "";// 所属类型
	private String imageUrl = "";// 缩略图路径
	private String attachFilePath = "";// 文件表格路径
	private String templateDisk = "";// 模板路径
	private String articleUrl = "";// 访问地址
	private int readCount = 0;// 阅读次数
	private int sortId = 0;// 序号
	private int isTop = 0;// 是否置顶0代表不置顶 1代表置顶
	private int isOnline = 0;// 是否上线、0未上线，1代码上线
	private int saveType = 0;// 保存类型：0手动保存，1网站抓取
	private int zanCount = 0;// 点赞数量

	private int companyId = 0;
	private String companyName = "";// 所属公司
	private int commentCount = 0;
	private int fileCount = 0;// 附件总数
	private int attachCount = 0;// 是否存在附件，为大于1代表存在为0代表不存在

	// =========================信息审核字段================
	private String checkerId = "";// 审核人id
	private String checker = "";// 审核人
	private String checkDT = "";// 审核日期
	private String checkUnitId = "";// 审核单位ID
	private String checkUnit = "";// 审核单位
	private String checkMsg = "";// 分局审核内容
	private int checkStatus = 0;// 0为待审核,1为已审核确认,2为审核末通过

	// =========================foot===================================
	// 操作信息
	@Commnent("编辑人ID")
	@Column(name = "editor_id", length = 11)
	private int editorId = 0;// 编辑人Id
	@Commnent("编辑人")
	@Column(name = "editor_name", length = 32)
	private String editorName = "";// 编辑人
	@Commnent("编辑时间")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "edit_time")
	private Date editTime;// 编辑时间
	@Commnent("创建人ID")
	@Column(name = "creater_id", length = 11)
	private int createrId = 0;// 编辑人Id
	@Commnent("创建人")
	@Column(name = "creater", length = 32)
	private String creater = "";// 编辑人
	@Commnent("创建时间")
	@Column(name = "create_time", length = 32)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	@Commnent("删除标识")
	@Column(name = "delete_flag", length = 1)
	private int deleteFlag = 0;// 默认为不删除，1为删除

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getArticleTitile() {
		return articleTitile;
	}

	public void setArticleTitile(String articleTitile) {
		this.articleTitile = articleTitile;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getArticleDetail() {
		return articleDetail;
	}

	public void setArticleDetail(String articleDetail) {
		this.articleDetail = articleDetail;
	}

	public String getColumnId() {
		return columnId;
	}

	public void setColumnId(String columnId) {
		this.columnId = columnId;
	}

	public String getColumnDir() {
		return columnDir;
	}

	public void setColumnDir(String columnDir) {
		this.columnDir = columnDir;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getArticleTypeId() {
		return articleTypeId;
	}

	public void setArticleTypeId(String articleTypeId) {
		this.articleTypeId = articleTypeId;
	}

	public String getArticleType() {
		return articleType;
	}

	public void setArticleType(String articleType) {
		this.articleType = articleType;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public String getTemplateDisk() {
		return templateDisk;
	}

	public void setTemplateDisk(String templateDisk) {
		this.templateDisk = templateDisk;
	}

	public String getArticleUrl() {
		return articleUrl;
	}

	public void setArticleUrl(String articleUrl) {
		this.articleUrl = articleUrl;
	}

	public int getReadCount() {
		return readCount;
	}

	public void setReadCount(int readCount) {
		this.readCount = readCount;
	}

	public int getSortId() {
		return sortId;
	}

	public void setSortId(int sortId) {
		this.sortId = sortId;
	}

	public int getIsTop() {
		return isTop;
	}

	public void setIsTop(int isTop) {
		this.isTop = isTop;
	}

	public int getIsOnline() {
		return isOnline;
	}

	public void setIsOnline(int isOnline) {
		this.isOnline = isOnline;
	}

	public int getSaveType() {
		return saveType;
	}

	public void setSaveType(int saveType) {
		this.saveType = saveType;
	}

	public int getZanCount() {
		return zanCount;
	}

	public void setZanCount(int zanCount) {
		this.zanCount = zanCount;
	}

	public int getCompanyId() {
		return companyId;
	}

	public void setCompanyId(int companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public int getCommentCount() {
		return commentCount;
	}

	public void setCommentCount(int commentCount) {
		this.commentCount = commentCount;
	}

	public int getFileCount() {
		return fileCount;
	}

	public void setFileCount(int fileCount) {
		this.fileCount = fileCount;
	}

	public int getAttachCount() {
		return attachCount;
	}

	public void setAttachCount(int attachCount) {
		this.attachCount = attachCount;
	}

	public String getCheckerId() {
		return checkerId;
	}

	public void setCheckerId(String checkerId) {
		this.checkerId = checkerId;
	}

	public String getChecker() {
		return checker;
	}

	public void setChecker(String checker) {
		this.checker = checker;
	}

	public String getCheckDT() {
		return checkDT;
	}

	public void setCheckDT(String checkDT) {
		this.checkDT = checkDT;
	}

	public String getCheckUnitId() {
		return checkUnitId;
	}

	public void setCheckUnitId(String checkUnitId) {
		this.checkUnitId = checkUnitId;
	}

	public String getCheckUnit() {
		return checkUnit;
	}

	public void setCheckUnit(String checkUnit) {
		this.checkUnit = checkUnit;
	}

	public String getCheckMsg() {
		return checkMsg;
	}

	public void setCheckMsg(String checkMsg) {
		this.checkMsg = checkMsg;
	}

	public int getCheckStatus() {
		return checkStatus;
	}

	public void setCheckStatus(int checkStatus) {
		this.checkStatus = checkStatus;
	}

	public int getEditorId() {
		return editorId;
	}

	public void setEditorId(int editorId) {
		this.editorId = editorId;
	}

	public String getEditorName() {
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	public int getCreaterId() {
		return createrId;
	}

	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	public String getSourceFrom() {
		return sourceFrom;
	}

	public void setSourceFrom(String sourceFrom) {
		this.sourceFrom = sourceFrom;
	}

	public String getOldTitle() {
		return oldTitle;
	}

	public void setOldTitle(String oldTitle) {
		this.oldTitle = oldTitle;
	}

	public String getAttachFilePath() {
		return attachFilePath;
	}

	public void setAttachFilePath(String attachFilePath) {
		this.attachFilePath = attachFilePath;
	}

	@Override
	public String toString() {
		return "Article [id=" + id + ", uuid=" + uuid + ", articleTitile=" + articleTitile + ", oldTitle=" + oldTitle
				+ ", keywords=" + keywords + ", content=" + content + ", sourceFrom=" + sourceFrom + ", status="
				+ status + ", articleDetail=" + articleDetail + ", columnId=" + columnId + ", columnDir=" + columnDir
				+ ", columnName=" + columnName + ", articleTypeId=" + articleTypeId + ", articleType=" + articleType
				+ ", imageUrl=" + imageUrl + ", attachFilePath=" + attachFilePath + ", templateDisk=" + templateDisk
				+ ", articleUrl=" + articleUrl + ", readCount=" + readCount + ", sortId=" + sortId + ", isTop=" + isTop
				+ ", isOnline=" + isOnline + ", saveType=" + saveType + ", zanCount=" + zanCount + ", companyId="
				+ companyId + ", companyName=" + companyName + ", commentCount=" + commentCount + ", fileCount="
				+ fileCount + ", attachCount=" + attachCount + ", checkerId=" + checkerId + ", checker=" + checker
				+ ", checkDT=" + checkDT + ", checkUnitId=" + checkUnitId + ", checkUnit=" + checkUnit + ", checkMsg="
				+ checkMsg + ", checkStatus=" + checkStatus + ", editorId=" + editorId + ", editorName=" + editorName
				+ ", editTime=" + editTime + ", createrId=" + createrId + ", creater=" + creater + ", createTime="
				+ createTime + ", deleteFlag=" + deleteFlag + "]";
	}

}
